package com.lhy.skywalking.finance.listener;

import com.alibaba.fastjson.JSON;
import com.lhy.skywalking.order.dto.OrderDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Slf4j
@RocketMQMessageListener(
        consumerGroup = "SK_ORDER_DETAILS_CONSUMER_GROUP",
        topic = "ORDER",
        selectorExpression = "DETALIS"
)
@Component
public class OrderDetailsMessageListener implements RocketMQListener<OrderDTO> {

    @Override
    public void onMessage(OrderDTO orderDTO) {
        log.info("[Order Details] received message:{}", JSON.toJSONString(orderDTO));
    }
}
